﻿using DeepSeek.ApiClient.Extensions;
using DeepSeek.ApiClient.Interfaces;
using Microsoft.Extensions.DependencyInjection;
using System.Windows;

namespace WpfApp5
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        IDeepSeekClient deepSeekClient;
        public MainWindow()
        {
            InitializeComponent();
            var services = new ServiceCollection();
            services.AddDeepSeekClient("sk-e080b2183bdd420bbf06456c9f700150");

            var serviceProvider = services.BuildServiceProvider();
            deepSeekClient = serviceProvider.GetRequiredService<IDeepSeekClient>();
            Loaded += MainWindow_Loaded;
        }

        private async void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            //Console.WriteLine("Application is started.");


            //Console.WriteLine("Send message is started.");
            //var request = new DeepSeekRequestBuilder()
            //  .SetModel(DeepSeekModel.V3)
            //  .SetStream(false)
            //  .SetTemperature(0)
            //  .SetSystemMessage("专业的程序员.")
            //  .AddUserMessage("你的api响应太慢了我可是花了钱的?");

            string response = await deepSeekClient.SendMessageAsync("你查下这个apikey还剩余多数钱吗?");
            string response2 = await deepSeekClient.SendMessageAsync("你为什么这么慢?");
            Console.WriteLine("Response: " + response);
        }
    }
}